The compose key should now work better with UIM (4/4).
authorDaniel Colascione <dancol@dancol.org>
Sun, 23 Mar 2014 11:44:21 +0000 (04:44 -0700)
committerRob Browning <rlb@defaultvalue.org>
Fri, 15 Aug 2014 22:14:40 +0000 (17:14 -0500)
This upstream patch has been added:

  Further improve XIM init

Origin: upstream, commit: r116856.1.4, 5307801ef2d4f1c2b6970b4f5a2d72bdd0285e15
Added-by: Rob Browning <rlb@defaultvalue.org>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753534

src/ChangeLog
src/xfns.c

index e41b5edc168157ccf36ab8c6045ed29e9c7941e4..71706616bcb22d8328d693bb73e0944b178ef584 100644 (file)
@@ -4,6 +4,10 @@
        only if xic_style calls for it.  This change allows Emacs to work
        with ibus.  Also, don't leak resources if create_frame_xic fails,
        and stop caching xic_style across different displays.
+       (supported_xim_styles): Make const.
+       (best_xim_style): Remove first parameter: it's always just
+       supported_xim_styles.  Change to look at supported_xim_styles
+       directly.
 
 2013-08-21  Paul Eggert  <eggert@cs.ucla.edu>
 
index 76036b8ad0e89b22ede3352ffbcbb224e38afc39..0d649c601b21e0cc4c566e38f3d9d909ade4bdce 100644 (file)
@@ -1838,12 +1838,12 @@ hack_wm_protocols (FRAME_PTR f, Widget widget)
 #ifdef HAVE_X_I18N
 
 static XFontSet xic_create_xfontset (struct frame *);
-static XIMStyle best_xim_style (XIMStyles *, XIMStyles *);
+static XIMStyle best_xim_style (XIMStyles *);
 
 
 /* Supported XIM styles, ordered by preference.  */
 
-static XIMStyle supported_xim_styles[] =
+static const XIMStyle supported_xim_styles[] =
 {
   XIMPreeditPosition | XIMStatusArea,
   XIMPreeditPosition | XIMStatusNothing,
@@ -2141,14 +2141,16 @@ xic_free_xfontset (struct frame *f)
    input method XIM.  */
 
 static XIMStyle
-best_xim_style (XIMStyles *user, XIMStyles *xim)
+best_xim_style (XIMStyles *xim)
 {
   int i, j;
+  int nr_supported =
+    sizeof (supported_xim_styles) / sizeof (supported_xim_styles[0]);
 
-  for (i = 0; i < user->count_styles; ++i)
+  for (i = 0; i < nr_supported; ++i)
     for (j = 0; j < xim->count_styles; ++j)
-      if (user->supported_styles[i] == xim->supported_styles[j])
-       return user->supported_styles[i];
+      if (supported_xim_styles[i] == xim->supported_styles[j])
+       return supported_xim_styles[i];
 
   /* Return the default style.  */
   return XIMPreeditNothing | XIMStatusNothing;
@@ -2166,7 +2168,6 @@ create_frame_xic (struct frame *f)
   XVaNestedList preedit_attr = NULL;
   XRectangle s_area;
   XPoint spot;
-  XIMStyles supported_list;
   XIMStyle xic_style;
 
   if (FRAME_XIC (f))
@@ -2177,10 +2178,7 @@ create_frame_xic (struct frame *f)
     goto out;
 
   /* Determine XIC style.  */
-  supported_list.count_styles = (sizeof supported_xim_styles
-                                 / sizeof supported_xim_styles[0]);
-  supported_list.supported_styles = supported_xim_styles;
-  xic_style = best_xim_style (&supported_list, FRAME_X_XIM_STYLES (f));
+  xic_style = best_xim_style (FRAME_X_XIM_STYLES (f));
 
   /* Create X fontset. */
   if (xic_style & (XIMPreeditPosition | XIMStatusArea))